//
//  MineInfoFooterView.m
//  WeiYiMei
//
//  Created by iMac on 2019/4/13.
//  Copyright © 2019年 liyefu. All rights reserved.
//

#import "MineInfoFooterView.h"
#import "ANGradientButton.h"

@interface MineInfoFooterView ()

@property (nonatomic, strong) ANGradientButton *button;

@end

@implementation MineInfoFooterView

- (void)setupSubViews
{
    self.backgroundColor = [UIColor clearColor];
    self.button = [[ANGradientButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW-kWidth(30), kWidth(48))];
    [self addSubview:self.button];
    [self.button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.button.titleLabel.font = [UIFont systemFontOfSize:16];
    self.button.layer.cornerRadius = kWidth(24);
    self.button.layer.masksToBounds = YES;
    [self.button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(kWidth(15));
        make.right.equalTo(self).offset(-kWidth(15));
        make.height.equalTo(@(kWidth(48)));
        make.bottom.equalTo(self).offset(-kWidth(10));
    }];
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    [self.button setTitle:title forState:UIControlStateNormal];
}

- (void)click:(id)sender
{
    if (self.sureHandler) {
        self.sureHandler();
    }
}
@end
